package com.woniuxy.util;


import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

public class BeanCopyUtil extends BeanUtils {

    public static <S,T> List<T> copyListPropertie(List<S> sources, Supplier<T> target){
        ArrayList<T> al = new ArrayList<>(sources.size());
        for(S source:sources){
            T t = target.get();
            copyProperties(source,t);
            al.add(t);
        }
        return al;
    }
}
